package com.chuangsi.common.enums;

import cn.hutool.core.util.StrUtil;

public enum DrivingExperienceEnum {


    oneToTwo(1, "1-2年")
    ,threeToFive(2, "3-5年")
    ,sixToTen(3, "6-10年")
    ,tenToMax(4, "10年及以上")
    ;


    /**
     * 风险级别
     */
    private Integer type;
    /**
     * 风险级别名称
     */
    private String typeName;

    DrivingExperienceEnum(Integer type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static String getName(Object type) {
        if(type == null|| StrUtil.isBlank(type.toString())){
            return "";
        }
        Integer myType = Integer.parseInt(type.toString());
        for (DrivingExperienceEnum saleStatusEnum : values()) {
            if(saleStatusEnum.getType().equals(myType)) return saleStatusEnum.getTypeName();
        }
        return "";
    }
}
